//
//  zhutiCollectionViewCell5.m
//  BAOASystem
//
//  Created by michael on 2018/5/28.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "zhutiCollectionViewCell5.h"

@implementation zhutiCollectionViewCell5
-(void)setDic:(NSDictionary *)dic{
    _dic = dic;
   
}
- (void)layoutSubviews{
[super layoutSubviews];
    NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count!=0) {
  NSDictionary *dic =ctgMainPushProductarray[0];
[_button1 sd_setImageWithURL:[NSURL URLWithString:dic[@"fileurl"]] forState:UIControlStateNormal];
_label1.text =dic[@"title"];
if (ctgMainPushProductarray.count>1) {
[_button2 sd_setImageWithURL:ctgMainPushProductarray[1][@"fileurl"] forState:UIControlStateNormal];
_label2.text =ctgMainPushProductarray[1][@"title"];

}
if (ctgMainPushProductarray.count>2) {
[_button3 sd_setImageWithURL:ctgMainPushProductarray[2][@"fileurl"] forState:UIControlStateNormal];
_label3.text =ctgMainPushProductarray[2][@"title"];

}
if (ctgMainPushProductarray.count>3) {
[_button4 sd_setImageWithURL:ctgMainPushProductarray[3][@"fileurl"] forState:UIControlStateNormal];
_label4.text =ctgMainPushProductarray[3][@"title"];

}
if (ctgMainPushProductarray.count>4) {
[_button5 sd_setImageWithURL:ctgMainPushProductarray[4][@"fileurl"] forState:UIControlStateNormal];
_label5.text =ctgMainPushProductarray[4][@"title"];

}
if (ctgMainPushProductarray.count>5) {
[_button6 sd_setImageWithURL:ctgMainPushProductarray[5][@"fileurl"] forState:UIControlStateNormal];
_label6.text =ctgMainPushProductarray[5][@"title"];

}
}


}
- (IBAction)action1:(id)sender {
NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count>0){
NSDictionary *dic =ctgMainPushProductarray[0];

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)action2:(id)sender {
NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count>1){
NSDictionary *dic =ctgMainPushProductarray[1];
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)action6:(id)sender {
NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count>5){
NSDictionary *dic =ctgMainPushProductarray[5];
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)action4:(id)sender {
NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count>3){
NSDictionary *dic =ctgMainPushProductarray[3];
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)action5:(id)sender {
NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count>4){
NSDictionary *dic =ctgMainPushProductarray[4];
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)action3:(id)sender {
NSArray *ctgMainPushProductarray = _dic[@"cppdlist"];
if (ctgMainPushProductarray.count>2){
NSDictionary *dic =ctgMainPushProductarray[2];
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}
@end
